﻿using System;
using Microsoft.WindowsAzure.StorageClient;

namespace LCA.Community.DAL.Model
{
    /// <summary>
    /// This class contains a single pair of users that are friends.
    /// 
    /// PartitionKey = ID of the first member of the pair.
    /// </summary>
    public class Friendship : BasicDataModel
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Friendship"/> class.
        /// </summary>
        public Friendship()
        {

        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Friendship"/> class.
        /// </summary>
        /// <param name="user">The user1.</param>
        /// <param name="friend">The user2.</param>
        public Friendship(string user, string friend)
        {
            RowKey = Guid.NewGuid().ToString();
            PartitionKey = user;
            Friend = friend;
        }

        /// <summary>
        /// Gets or sets the user.
        /// </summary>
        /// <value>The user.</value>
        public string User
        {
            get
            {
                return PartitionKey;
            }
            set
            {
                PartitionKey = value;
            }
        }
        /// <summary>
        /// Gets or sets the friend of the user.
        /// </summary>
        /// <value>The user's friend.</value>
        public string Friend { get; set; }
    }
}
